package com.elm.controller;

import com.elm.common.R;
import com.elm.dao.UserDao;
import com.elm.domain.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@ResponseBody
@RequestMapping("/api/manage")
public class ManageController {

    @Autowired
    private UserDao userDao;

    @GetMapping("/{userId}")
    public R verify(@PathVariable String userId)
    {
        User user = userDao.selectById(userId);
        if(user!=null)
        {
            if(user.getStatus()!=2)
            {
                return R.error("您没有权限");
            }
        }
        else return R.error("您没有权限");

        return R.success("成功");
    }
}
